home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 47.7z / BS1 part 47 / ImageMaster RT v1.50b (1994)(Black Belt Systems)(Disk 1 of 7)[HD].7z / ImageMaster RT v1.50b (1994)(Black Belt Systems)(Disk 1 of 7)[HD].adf / makedata.diag < prev    next >
Encoding:
Text File  |  1994-04-19  |  4.5 KB  |  165 lines

  1. /* makedata.rexx */
  2.  
  3. /*
  4.  * Written by Ben Williams
  5.  * -----------------------
  6.  * March 7th, 1994
  7.  * for Black Belt Systems
  8.  */
  9.  
  10. /*
  11.  * open rexxsupport.library -- needed for some functions
  12.  */
  13. if ~show('L',"rexxsupport.library") then do
  14.   if addlib('rexxsupport.library',0,-30,0) then do
  15.       /* everything's ok */
  16.     end;
  17.   else do
  18.     say 'We Have A Library Problem, Unable To Load "rexxsupport.library"';
  19.     say 'Cannot operate makedata.rexx without this library - sorry!';
  20.     exit 1;
  21.     end;
  22.   end;
  23.  
  24. filename = "ram:imdatagen_aa.doc";
  25. tfilename = "ram:aa.tmp_tmp_tmp.aa"
  26.  
  27.   address command 'avail  >'||tfilename
  28.   if open(tmphandle,tfilename,read)=1 then do
  29.     tdata = readln(tmphandle); /* title line */
  30.     cdata = readln(tmphandle); /* chip line  */
  31.     fdata = readln(tmphandle); /* fast line  */
  32.     mdata = readln(tmphandle); /* max line */
  33.     err = close(tmphandle);
  34.     end
  35.   else do
  36.     say 'cannot open '||tfilename;
  37.     exit 2
  38.     end
  39.  
  40.   address command 'version  >'||tfilename
  41.   if open(tmphandle,tfilename,read)=1 then do
  42.     vdata = readln(tmphandle);
  43.     err = close(tmphandle);
  44.     end
  45.   else do
  46.     say 'cannot open '||tfilename;
  47.     exit 3
  48.     end
  49.  
  50.   address command 'cpu >'||tfilename
  51.   if open(tmphandle,tfilename,read)=1 then do
  52.     xdata = readln(tmphandle);
  53.     err = close(tmphandle);
  54.     end
  55.   else do
  56.     say 'cannot open '||tfilename;
  57.     exit 3
  58.     end
  59.  
  60.   address command 'which >'||tfilename||' rx';
  61.   if open(tmphandle,tfilename,read)=1 then do
  62.     rxdata = readln(tmphandle);
  63.     err = close(tmphandle);
  64.     end
  65.   else do
  66.     say 'cannot open '||tfilename;
  67.     exit 4
  68.     end
  69.  
  70.   address command 'assign >'||tfilename
  71.   haverexx = 0;
  72.   if open(tmphandle,tfilename,read)=1 then do
  73.     looping = 1
  74.     do while looping = 1
  75.       adata = readln(tmphandle);
  76.       parse var adata key remainder
  77.       if key = 'Directories:' then looping = 0;
  78.       end
  79.     looping = 1;
  80.     do while looping = 1
  81.       adata = readln(tmphandle);
  82.       parse var adata key remainder
  83.       if key = 'Devices:' then looping = 0;
  84.       key = upper(key);
  85.       if key = 'REXX' then do
  86.         looping = 0;
  87.         haverexx = 1;
  88.         end
  89.       end
  90.     err = close(tmphandle);
  91.     end
  92.   else do
  93.     say 'cannot open '||tfilename;
  94.     exit 5
  95.     end
  96.  
  97.  haveim = 0;
  98.  plist = showlist('p');
  99.  looping = 1;
  100.  do while looping = 1
  101.      parse var plist punga plist;
  102.      if punga = 'IM_Port' then do 
  103.        haveim = 1;
  104.        looping = 0;
  105.        end
  106.      if punga = '' then looping = 0;
  107.      end;
  108.  
  109.    if haveim = 1 then do
  110.      options results;
  111.      address 'IM_Port' 'version';
  112.      options;
  113.      vx = result;
  114.      parse var vx ver ',' rev;
  115.      end
  116.   
  117.   if open(handle,filename,Write)=1 then do
  118.     cnt = writeln(handle,'\ApAssist');
  119.     cnt = writeln(handle,'\: Automatically generated ApAssist file');
  120.     cnt = writeln(handle,'\node "amigadata"');
  121.     cnt = writeln(handle,'\title "System Information');
  122.     cnt = writeln(handle,'\next ""');
  123.     cnt = writeln(handle,'\prev ""');
  124.     cnt = writeln(handle,'\nw');
  125.     cnt = writeln(handle,'');
  126.     cnt = writeln(handle,'\{ \ts bu System Configuration on '||date()||' at '||time(normal)||'\}');
  127.     cnt = writeln(handle,'');
  128.     parse var cdata mtype mavail minuse mmax mlarge
  129.     cnt = writeln(handle,'Chip Memory: '||mmax);
  130.     parse var fdata mtype mavail minuse mmax mlarge
  131.     cnt = writeln(handle,'Fast memory: '||mmax);
  132.     cnt = writeln(handle,vdata);
  133.     cnt = writeln(handle,xdata);
  134.     if haverexx=1 then do
  135.       parse var adata key ' ' aadata;
  136.       aadata = strip(aadata);
  137.       cnt = writeln(handle,'Rexx is assigned to \{ \tc DarkBlue '||aadata||'\}');
  138.       end
  139.     else do
  140.       cnt = writeln(handle,'\{ \tc Red REXX: is \{ \ts ui not\} \= assigned!\}');
  141.       cnt = writeln(handle,'\{\ts b Press Here to learn more about: \} \link " Assigning Rexx " "imdoc:re_hlp/re_pathrx"');
  142.       end
  143.     if haveim=1 then do
  144.       cnt = writeln(handle,'Imagemaster R/t version \{ \tc DarkBlue '||ver||'.'||rev'\}');
  145.       end
  146.     else do
  147.       cnt = writeln(handle,'\{ \tc Red Imagemaster R/t is not running - '||"can't"||' tell version! \}');
  148.       end
  149.     if rxdata="" then do
  150.       cnt = writeln(handle,'\{ \tc Red Cannot locate RX command - No Path! \}');
  151.       cnt = writeln(handle,'\{ \ts b Press Here to learn more about: \} \link "  Locating RX  " "imdoc:re_hlp/re_assignrx"');
  152.       end
  153.     else do
  154.       cnt = writeln(handle,'Path to the RX command is \{ \tc DarkBlue '||rxdata||'\}');
  155.       end
  156.     cnt = writeln(handle,'\endnode');
  157.     err = close(handle);
  158.     end
  159.   else do
  160.     say "OUCH! Can't open output file!"
  161.     exit 6
  162.     end
  163.  
  164. address command 'delete '||tfilename||' >nil:';
  165.